<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
	<head>
		<title>井冈山智慧社区</title>
		<script type="text/javascript" src="<%=basePath %>Scripts/jquery/jquery-1.10.2.js"></script> 			
		<script type="text/javascript" src="<%=basePath%>pages/WebSitePc/js/asynPage.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>pages/WebSitePc/css/asynPage.css"/>		
		<script type="text/javascript" src="<%=basePath %>pages/IntranetPc/jsAndcss/index.js"></script> 		
		<link rel="stylesheet" type="text/css" href="<%=basePath%>pages/IntranetPc/jsAndcss/index.css"/> 
		
		<script type="text/javascript">
			$(function(){
				var categoryId='';
				if('${data.categoryId}'!=null && '${data.categoryId}'!=''){							
					 categoryId='${data.categoryId}';
				}			
				
				getArticleByPage(categoryId);
				
			});		
			
			//查找所有文章--有分页
			function getArticleByPage(categoryId){
				var params = "categoryID="+categoryId;
				var pageUrl='<%=basePath%>/WebIntranetPc/queryArticlePage.json';	
				$("#paging").asynPage(pageUrl,params,".articlePage",buildHtmlAdd,15,"rows","total");	
				
			}
			
			//异步分页--创建文章列表
			function buildHtmlAdd(data){					    	
				if(data!=null && data.length>0){		    		
					var articleList='<ul>';					    	
					$.each(data,function(idx,obj){		    			
						var maxwidth=55; 
						if(obj.title.length>maxwidth){
							obj.title=obj.title.substring(0,maxwidth);
							obj.title+=' ...'; 
						}	       
						var url='../WebIntranetPc/IntranetArticle.htm?id='+encode64((obj.id).toString());
						
						var addhtml = '<li><a target="_blank" style="color:'+obj.titleColor+'" href="'+url+'">'+obj.title+'</a>'+
									      '<span class="date">'+new Date(obj.modifyDate).format("yyyy-MM-dd")+'</span>'+
								      '</li>';
						articleList+=addhtml;	    
					});		    		
					articleList+='</ul>';		
					$(".articlePage").append(articleList);			    		
				}else{
					$(".articlePage").append('没有符合条件的数据!');
				}			
			}
			
		</script>
	</head>
<body>	
	<!--Header Holder-->
	<div class="top2">
		<div class="topBody2">
			<div class="logo2"></div>
			<div class="out2">
				<a target="_blank"  href="http://10.162.121.50/Thome/login!logout.action">
					<img src="<%=basePath%>pages/IntranetPc/jsAndcss/images/out.png"/>
					退出
				</a>
			</div>
			<div class="clear"></div>
		</div>
	
	</div>
	<!--main start-->	
	<div class="main">
		<div class="cate01">
			<div class="crumbs">
				您现在位置：<a href="http://10.162.121.50/Thome/thome!list.action" target="_self">首页</a> &gt;
				<a href = "#" target = "_self">
					<font color="#2c95b7">工作动态</font>
				</a >
			</div>											
			<!-- 文章列表 分页 -->					
			<div class="pageList">
				<div class="articlePage"></div>
				<div id="paging" class="page"></div>				
		    </div>					
		</div>		
		<div class="clear"> </div>			
	</div>	
	<div class="footer">
			<span>Copyright © 2015 版权所有 井冈山智慧社区　技术支持：江西电信信息产业公司</span>		
	</div>
</body>
</html>